package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/project/page")
    public TableDataInfo<List<NursingProject>> project(NursingProject nursingProject){
        startPage();
        List<NursingProject> nursingProjects = nursingProjectService.selectNursingProjectList(nursingProject);
        return  getDataTable(nursingProjects);
    }

    @GetMapping("/project/{id}")
    public R<NursingProject> getById(@PathVariable Long id){
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return R.ok(nursingProject);
    }
}
